<html>

<head>

<link rel = "stylesheet" type = "text/css" href = "newguestcss.css"/>

<script type="text/javascript" src="guest.js"></script>



<script type = "text/javascript">
var remote = null;
window.name = "content";
function openRemote(contentURL,windowName,x,y){
	widthHeight = 'height = '+ y +'width='+x;
	if (remote) remote.focus();
	else var remote = window.open(contentURL,windowName,widthHeight);
	}

	
	
	
	
	
	
	
	
	</script>












</head>

<body>

	

<table cellspacing="10">
<tr>
	<td class = "td1">
		<div>
			
			
			<br/>
			<br/>


		</div>
	</td>
</tr>
</table>

<table>
	<tr valign = "top">
		<td class = "td2">
		
		<div  onclick = "openRemote('remote.html','remote',150,300)">
		
			<h5 style = "border:1px dotted blue;padding:10px 10px "><a href = "javascript:openRemote('remote.html','remote',400,300)"><img width = '50' src = 'remote/remote1.png'/>REMOTE</a></h5>
		
		
		
		</div>
		
			<a href = "Profile.php" >Home</a><hr/>
			<a href = "newGuestBook.php" >Comment</a><br/><hr/>
			<a href = "newGuestBook.php" >View comment</a><br/><hr/>
			<a href = "Profile.php" >Author</a><br/><hr/>
			
	
	
			
	
	
	
		</td>
		<td class = "td3">
		
	
		
		<div>
					<?php
			$host="localhost"; // Host name 
			$username="root"; // Mysql username 
			$password=""; // Mysql password 
			$db_name="test"; // Database name 
			$tbl_name="approved"; // Table name

			// Connect to server and select database.
			mysql_connect("$host", "$username","")or die("cannot connect server "); 
			mysql_select_db("$db_name")or die("cannot select DB");
		
			$datetime=$_POST['datetime']; 
			$name = $_POST['aname'];
			$email = $_POST['email'];
			$comment = $_POST['comment'];
			$sql="INSERT INTO $tbl_name(name, email, comment, datetime)VALUES('$name', '$email', '$comment', '$datetime')";
			print_r($sql);
			$result=mysql_query($sql);
			
			//check if query successful 
			if($result){
			echo "Your Comment is Approved";
			echo "<BR/>";
			echo "<center><a href='NewViewGuestBook.php'>View guestbook</a></center>"; // link to view guestbook page 
			}

			else {
			echo "ERROR";
			}

			mysql_close();
			?>

		

		
		
		</div>
		
		</td>
		<td class = "td4">
		<dl class="dropdown"> 
				
					<dt id="one-ddheader" onmouseover="ddMenu('one',1)" onmouseout="ddMenu('one',-1)">
					<h4 style="background-image:url(image/back4.jpg)">Hidden navigation</h4>
					
					</dt> 
					  <dd id="one-ddcontent" onmouseover="cancelHide('one')" onmouseout="ddMenu('one',-1)"> 
					<a href= "www.google.com"><img width = '40' class = "bimg" src = "PNG/Google.png"/></a><br/>
						
						<a href= "guestbook.php"><img width = '40' class = "bimg" src = "PNG/Yahoo.png"/></a><br/>
						<a href= "guestbook.php"><img width = '40'  class = "bimg"src = "PNG/Twitter.png"/></a><br/>
						<a href= "guestbook.php"><img width = '40'  class = "bimg"src = "PNG/Youtube.png"/></a><br/>
						<a href= "guestbook.php"><img width = '40'  class = "bimg"src = "PNG/Myspace.png"/></a><br/>
						
					
					 </dd> 
					</dl> 		
		
		
		
		
		</td>
	</tr>
	





</table>
<table width="100%"  border="0" cellpadding="15" cellspacing="0" class="footer">  
<tr>   
<td align='center'>ADD St. Brgy. Sampaloc, Apalit, Pampanga. Tel. (045) 879-1536
<br /> 
&copy; 2010 Copyright. La Verdad Christian College. All rights reserved.
</td>  
<td valign="bottom"></td>  
</tr>
</table>
</body>


	


</html>
